<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>ValidationAide - Custom Rules</title>
	<link href="_client/styles/master.css" media="screen,projection" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="_client/scripts/jquery/jquery.js"></script>
	<script type="text/javascript" src="_client/scripts/jquery/stringaide.js"></script>
	<script type="text/javascript" src="_client/scripts/jquery/validationaide.js"></script>
	<script type="text/javascript">
		jQuery.noConflict(); var $j = jQuery;
		
		$j(document).ready(function() {
			var myRules = jQuery.validationAide.getDefaultValidationRules();
			myRules.add('validator-must-be-hello', 'Must be HELLO', function(fieldValue, fieldObj) {
				if (fieldValue != "HELLO")	return false;
				return true;
			});
			
			$j("#TestForm").validationAideEnable(myRules);
		});
	</script>
</head>
<body>

<h1>ValidationAide - Custom Rules</h1>

<p>Example of adding your own rules to the default set of rules.</p>

<form id="TestForm">
	
	<div id="ClientValidationSummary"></div>
	
	<label for="FirstName">
		<span class="label">First name: <span class="required">*</span></span>
		<input type="text" id="FirstName" class="textbox validator-required" />
	</label>
	
	<label for="Surname">
		<span class="label">Surname: <span class="required">*</span></span>
		<input type="text" id="Surname" class="textbox validator-required" />
	</label>
	
	<label for="Email">
		<span class="label">Email: <span class="required">*</span></span>
		<input type="text" id="Email" class="textbox validator-required validator-email" />
	</label>
	
	<label for="Company">
		<span class="label">Company:</span>
		<input type="text" id="Company" class="textbox" />
	</label>
	
	<label for="Hello">
		<span class="label">Type "HELLO": <span class="required">*</span></span>
		<input type="text" id="Hello" class="textbox validator-required validator-must-be-hello" />
	</label>
	
	<label for="HasReadTerms">
		<span class="label">Read Terms?</span>
		<input type="checkbox" id="HasReadTerms" class="checkbox validator-required" />
	</label>
	
	<div class="toolbar">
		<input type="submit" value="Submit" />
	</div>
	
</form>

</body>
</html>